package com.sys.ai.controller;

import com.alibaba.fastjson2.JSON;
import com.sys.ai.fo.SendMessageFO;
import com.sys.ai.service.AiService;
import com.sys.common.core.controller.BaseController;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author LGY
 * Create by 2025/5/8 10:05
 */
@Slf4j
@RestController
@RequestMapping("/tool/ai")
public class AiController extends BaseController {

    @Autowired
    private AiService aiService;

    @PostMapping("/sendMessage")
    public void sendMessage(@RequestBody SendMessageFO sendMessageFO) {
        log.info("发送AI问答消息入参 - 普通：{}", JSON.toJSONString(sendMessageFO));
        aiService.sendStreamMessage(sendMessageFO);
    }
}
